package com.own.business.resource.core.model;

import lombok.Getter;

/**
 * DownloadFile
 *
 * @author Chenxueli
 * @date 2019/7/2 9:13
 */
@Getter
public class DownloadFile {

    /**
     * 文件路径
     */
    private final String path;
    /**
     * 文件后缀
     */
    private final String suffix;
    /**
     * 文件名称
     */
    private String name;

    public DownloadFile(String path) {
        super();
        this.path = path;
        this.name = path.substring(path.lastIndexOf("/") + 1, path.lastIndexOf("."));
        this.suffix = path.substring(path.lastIndexOf("."));
    }

    public DownloadFile setName(String name) {
        this.name = name;
        return this;
    }

}
